package com.dabai.iot.core.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dabai.iot.core.dto.DeviceGroupBind;
import com.dabai.iot.core.entity.DeviceGroupEntity;

import java.util.List;

/**
 * 设备分组 Service 接口
 *
 * @author kev1n
 */
public interface IDeviceGroupService extends IService<DeviceGroupEntity> {

    /**
     * 新增
     *
     * @param deviceGroup
     */
    boolean addDeviceGroup(DeviceGroupEntity deviceGroup);

    /**
     * 修改
     *
     * @param deviceGroup
     */
    boolean updateDeviceGroup(DeviceGroupEntity deviceGroup);

    /**
     * 删除
     *
     * @param id
     */
    boolean removeDeviceGroup(Long id);

    /**
     * 树形结构
     */
    List<Tree<Long>> tree(String tenantId);

    /**
     * 绑定设备
     */
    boolean bindDevice(DeviceGroupBind entity);

    /**
     * 解绑设备
     */
    boolean unbindDevice(DeviceGroupBind entity);

}
